//
//  YWInspectionEquipmentRecord.h
//  maintain
//
//  Created by Kyo on 16/5/26.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
@class YWHandler;
@class YWInspectionLineModel;
@class YWEquipment;
@class YWLocation;

typedef NS_ENUM(NSUInteger, YWInspectionEquipmentRecordUploadStatus) {
    YWInspectionEquipmentRecordUploadStatusNull = 0,
    YWInspectionEquipmentRecordUploadStatusUploading = 1,
    YWInspectionEquipmentRecordUploadStatusFinished = 2, //上传
    YWInspectionEquipmentRecordUploadStatusUnFinished = 3, //未上传
};

typedef NS_ENUM(NSUInteger, YWInspectionEquipmentRecordStatus) {
    YWInspectionEquipmentRecordStatusNormal = 0, //正常
    YWInspectionEquipmentRecordStatusTrouble = 1, //故障
};

typedef NS_ENUM(NSUInteger, YWInspectionEquipmentRecordType) {
    YWInspectionEquipmentRecordTypeEquipment = 0, //巡查设备的记录
    YWInspectionEquipmentRecordTypeLocation = 1, //巡查位置的记录
};

@interface YWInspectionEquipmentRecord : NSObject
/**巡查线路ID*/
@property (nonatomic, assign) NSInteger inspectionLineId;
/**巡查线记录标识*/
@property (nonatomic, copy) NSString* uniqueTag;
/**巡查明细唯一ID（关联报障信息）*/
@property (nonatomic, copy) NSString *detailUniqueTag;
/**记录Id*/
@property (nonatomic, copy) NSString* equipmentRecordId;
/**状态(故障，正常)*/
@property (nonatomic, assign) YWInspectionEquipmentRecordStatus status;
/**巡查人*/
@property (nonatomic, strong) YWHandler *executor;
/**巡更完成时间*/
@property (nonatomic, assign) NSTimeInterval executeTime;
/**设备对象*/
@property (nonatomic, strong) YWEquipment *equipment;
/**设备ID*/
@property (nonatomic, strong) NSString *equipmentId;
/**位置对象*/
@property (nonatomic, strong) YWLocation *location;
/**位置ID*/
@property (nonatomic, assign) NSInteger locationId;
/**记录类型*/
@property (nonatomic, assign) YWInspectionEquipmentRecordType recordType;
/**巡查备注*/
@property (nonatomic, copy) NSString *note;
/**上传状态*/
@property (nonatomic, assign) YWInspectionEquipmentRecordUploadStatus uploadStatus;
/**图片数组*/
@property (nonatomic, strong) NSArray *pictures;
/**巡查任务id*/
@property (nonatomic, assign) NSInteger inspectionMissionId;
/**自定义属性数组（现用于提交记录时用,解析数据也用）*/
@property (nonatomic, strong) NSArray *equipmentFields;
/**日月用于显示(设备详情页进详情页显示用)*/
@property (nonatomic, copy) NSString *dayMonthString;

//提交记录时关联提交报障信息(解析时也用)
@property (nonatomic, strong) NSArray *posTroubleArray;
@end

//网络数据解析用
@interface YWInspectionEquipmentRecordJson : NSObject
/**巡更线记录标识*/
@property (nonatomic, copy) NSString* uniqueTag;
/**线路,包含ID和name*/
@property (nonatomic, strong) YWInspectionLineModel *inspectionLine;
/**巡查任务id*/
@property (nonatomic, assign) NSInteger inspectionMissionId;
/**巡查记录，YWInspectionEquipmentRecord对象,包含下面四种类型(改字段不解析)*/
@property (nonatomic, strong) NSMutableArray *allKindRecord;

//设备巡查结果(包含临时设备巡查结果)
@property (nonatomic, strong) NSArray* equipmentRecords;
//位置巡查结果(包含临时位置巡查结果)
@property (nonatomic, strong) NSArray* locationRecords;
@end

//解析台账获取巡查点记录
@interface YWInspectionLocationRecordJson : NSObject
/**巡查明细唯一ID（关联报障信息）*/
@property (nonatomic, copy) NSString *detailUniqueTag;
//关联报障信息
@property (nonatomic, strong) NSArray *posTroubleArray;
/**执行时间*/
@property (nonatomic, assign) NSTimeInterval executeTime;
/**巡更人*/
@property (nonatomic, strong) YWHandler *executor;
/**巡更记录标识*/
@property (nonatomic, copy) NSString *uniqueTag;
/**巡更备注*/
@property (nonatomic, copy) NSString *note;
/**巡更图片*/
@property (nonatomic, strong) NSArray *pictures;
/**结果状态*/
@property (nonatomic, assign) NSInteger status;
@end
